package cultu.supplier.dao.jpa;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import cultu.framework.dao.jpa.GenericDAOjpa;
import cultu.supplier.dao.AnnotationDAO;
import cultu.supplier.message.Annotation;
import cultu.supplier.message.AnnotationCriteria;
import cultu.supplier.message.AnnotationScenario;

/**
 * The Class AnnotationDAOjpa.
 */
public class AnnotationDAOjpa extends GenericDAOjpa<Annotation, AnnotationCriteria, AnnotationScenario> implements AnnotationDAO
{

  /** The Constant LOG. */
  private static final Log LOG = LogFactory.getLog(AnnotationDAOjpa.class);

  /**
   * @see cultu.framework.dao.BaseDAO#get(java.lang.Object, java.lang.Object)
   */
  public Annotation get(Annotation t, AnnotationScenario s)
  {
    Annotation result = null;

    if(t != null && t.getHjid() != null)
    {
      result = get(t.getHjid());
    }

    return result;
  }



  /**
   * @see cultu.framework.dao.jpa.GenericDAOjpa#update(cultu.core.message.BaseEntity)
   */
  @Override
  public Annotation update(Annotation p)
  {
    return entityManager.merge(p);
  }

  /**
   * @see cultu.framework.dao.jpa.GenericDAOjpa#validateEntity(cultu.core.message.BaseEntity)
   */
  @Override
  protected boolean validateEntity(Annotation pEntity)
  {
    return true;
  }
}
